package com.reading.core.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author guwenqi_1995@163.com
 * @date 2019/7/8 9:25 AM
 **/
@Getter
@AllArgsConstructor
public enum ExceptionCode {

    SUCC(0, "成功"),

    ERROR(-1, "失败"),


    //----------------------------------- 1开头 图书相关异常 -----------------------------------//

    BOOK_NOT_EXISTS(101, "图书不存在。"),

    BOOK_CHAPTER_NOT_EXISTS(102, "本章节不存在。"),

    BOOK_NEW_BUILD_FAIL(103, "新建图书失败 。"),

    BOOK_ADD_CHAPTER_FAIL(104, "图书添加章节失败。"),


    //----------------------------------- 2开头 用户相关异常 -----------------------------------//

    REGISTER_FAIL(201, "注册失败。"),

    REGISTER_ACCOUNT_ALREADY_EXISTS(202, "注册失败，账户已存在。"),

    LOGIN_ACCOUNT_PASSWORD_FAIL(212, "登入失败，账号密码错误。"),

    LOGIN_ACCOUNT_NOT_EXISTS(213, "登入失败，账号不存在。"),

    SEND_VALIDATER_CODE_FAIL(214, "发送验证码失败。"),


    //----------------------------------- 3开头 点赞、收藏、评论 相关异常 -----------------------------------//

    LIKE_BOOK_FAIL(301, "点赞错误。"),

    COLLECT_BOOK_FAIL(302, "收藏错误。"),

    //----------------------------------- 4开头 标签相关异常 -----------------------------------//

    LABEL_NEW_BUILD_FAIL(401, "新建标签错误。"),

    LABEL_DELETE_FAIL(402, "删除标签错误。"),

    LABEL_ADD_FAIL(403, "添加标签错误。"),

    LABEL_UNADD_FAIL(404, "取消标签错误。"),

    //----------------------------------- 9开头 系统相关异常 -----------------------------------//

    SEQUENCE_NEW_BUILD_FAIL(701, "新建sequence错误。"),

    ;

    private Integer errorCode;

    private String errorDescr;
}
